package Factory;

public class ShapeFactory {

    public Shape getShape(String shapeType){
        if (shapeType == null){
            return null;
        }else if (shapeType.equalsIgnoreCase("Circle")){
            return new Circle();
        }else if (shapeType.equalsIgnoreCase("Square")){
            return new Square();
        }else if (shapeType.equalsIgnoreCase("Rectangle")){
            return new Rectangle();
        }

        return null; // 前面有的话 直接return , 不回影响到

    }
}
